<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../../assets/css/base.css">
  <style>
    .flex-container {
      display: flex;
      /*
        flex-wrap 换行方式
         ● nowrap
         ● wrap
         ● wrap-reverse
       */
      flex-wrap: nowrap;
      width: 300px;
      height: 300px;
      border: 1px solid black;
    }

    .flex-container>div {
      width: 100px;
      height: 100px;
      color: white;
      font-size: 20px;
      line-height: 100px;
      text-align: center;
    }

    .flex-container>div:nth-child(1) {
      background-color: red;
    }

    .flex-container>div:nth-child(2) {
      background-color: orange;
    }

    .flex-container>div:nth-child(3) {
      background-color: yellow;
    }

    .flex-container>div:nth-child(4) {
      background-color: green;
    }

    .flex-container>div:nth-child(5) {
      background-color: cyan;
    }

    .flex-container>div:nth-child(6) {
      background-color: blue;
    }

    .flex-container>div:nth-child(7) {
      background-color: purple;
    }

    .nowrap {
      flex-wrap: nowrap;
    }

    .wrap {
      flex-wrap: wrap;
    }

    .wrap-reverse {
      flex-wrap: wrap-reverse;
    }
  </style>
</head>

<body>
  <div class="float-left margin-left-10">
    <p class="title">nowrap</p>
    <div class="flex-container nowrap">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>6</div>
      <div>7</div>
    </div>
  </div>

  <div class="float-left margin-left-10">
    <p class="title">wrap</p>
    <div class="flex-container wrap">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>6</div>
      <div>7</div>
    </div>
  </div>

  <div class="float-left margin-left-10">
    <p class="title">wrap-reverse</p>
    <div class="flex-container wrap-reverse">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>6</div>
      <div>7</div>
    </div>
  </div>
</body>

</html>